package com.wyc.apiPassenger.feign;

import com.wyc.internalCommon.request.VerificationCodeDTO;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("service-passenger-user")
public interface ServicePassengerUserFeignClient {

    /**
     * 根据手机号查询是否存在该乘客，不存在新增
     * @return
     */
    @PostMapping("/user")
    ApiResult loginOrReg(@RequestBody VerificationCodeDTO verificationCodeDTO);

    /**
     * 根据手机号查询乘客信息
     * @return
     */
    @GetMapping ("/user/{phone}")
    ApiResult getUserByPhone(@PathVariable("phone") String passengerPhone);

}
